﻿using System.Web;
using System.Web.Optimization;

namespace Survey.Web
{
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            //BundleTable.EnableOptimizations = true;

            RegisterCss(bundles);
            RegisterJs(bundles);
        }

        public static void RegisterJs(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle(Const.JsJQuery)
                .Include("~/Scripts/jquery-{version}.js",
                         "~/Scripts/jquery.address-{version}.js",
                         "~/Scripts/jquery.cookie.js",
                         "~/Scripts/jquery.validate.js",
                         "~/Scripts/json2template.js"
                ));

            bundles.Add(new ScriptBundle(Const.JsJQueryUI)
                .Include("~/Scripts/jquery-ui-{version}.custom.js",
                         "~/Scripts/jquery-ui-i18n.js"
                ));

            bundles.Add(new ScriptBundle(Const.JsBase)
                .Include("~/Scripts/base/*.js"));

            bundles.Add(new ScriptBundle(Const.JsProject)
                .Include("~/Scripts/project/*.js"));


        }

        public static void RegisterCss(BundleCollection bundles)
        {

            bundles.Add(new StyleBundle(Const.CssJQueryUI)
                .Include("~/Content/jQueryUI/jquery-ui-{version}.custom.css"));

            bundles.Add(new StyleBundle(Const.CssBase)
                .Include("~/Content/base/110Basic.css",
                         "~/Content/base/120Color.css",
                         "~/Content/base/210Layout.css",
                         "~/Content/base/230WidthHeight.css",
                         "~/Content/base/240TreeView.css",
                         "~/Content/base/310DetailSearch.css",
                         "~/Content/base/320List.css",
                         "~/Content/base/330Document.css"));

            bundles.Add(new StyleBundle(Const.CssProject)
                .Include("~/Content/project/*.css"));
        }
    }
}